package org.bt4girls.common.model.dto;

import lombok.Data;
import lombok.experimental.Accessors;
import org.bt4girls.common.model.oauth.TbUserBase;
import org.bt4girls.common.model.oauth.TbUserPermission;

import java.util.List;

@Data
@Accessors(chain = true)
public class UserBaseDTO {

    private TbUserBase user;

    private List<TbUserPermission> permission;

    private String accessToken;

    private String refreshToken;

    /***
     * 数据脱敏 SET 方法
     * @param user 原始类
     */
    public UserBaseDTO setUser(TbUserBase user) {
        user.setPassword(null);
        this.user = user;
        return this;
    }

}
